<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%--<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>--%>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>呆蜗牛Demo</title>
	<link href="/assets/themes/adminLTE/adminLTE/css/AdminLTE.min.css" rel="stylesheet">
	<link href="/assets/themes/adminLTE/adminLTE/css/skins/_all-skins.min.css" rel="stylesheet">
	<link href="/assets/themes/adminLTE/bootstrap/css/bootstrap.min.css" rel="stylesheet">

	<link href="/assets/common.css" rel="stylesheet">

	<!--[if lt IE 9]><!--<script src="/assets/html5shiv/dist/html5shiv.js"></script>--><![endif]-->

	<script src="/assets/themes/adminLTE/jquery/jquery.min.js"></script>
</head>
<body class="skin-purple layout-top-nav">
	<div class="wrapper">
		<!-- Main Header -->
		<header class="main-header">
			<jsp:include page="/WEB-INF/pages/header.jsp"/>
		</header>

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Main content -->
			<div class="container">
				<jsp:include page="/WEB-INF/pages/msgTip.jsp"/>
				<div class="box-body">
					<div class="alert alert-info alert-dismissible">
						<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
						<h4><i class="icon fa fa-bullhorn"></i> V 1.0.4 版本新功能（2016-05-23）</h4>
						<ol>
							<li>无聊，美化了下登录页面和注册页面...（心累）！</li>
							<li>同一个用户在其它地方又上线的话，系统会给自己发重复上线提示...（心累）！</li>
						</ol>
					</div>
					<div class="alert alert-warning alert-dismissible">
						<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
						<h4><i class="icon fa fa-info"></i> 大神正以蜗牛速度积极开发中的功能（时间待定）</h4>
						<ol>
							<li>支持直接通过<strong>www.daiwoniu.com</strong>访问，期待ING...（心累）！</li>
							<li>支持QQ登录功能，期待ING...（心累）！</li>
							<li>支持已注册账号和QQ绑定功能，期待ING...（心累）！</li>
							<li>支持一对一聊天功能，期待ING...（心累）！</li>
							<li>支持查看访客个人信息功能，期待ING...（心累）！</li>
							<li>支持自定义头像和个性签名功能，期待ING...（心累）！</li>
						</ol>
					</div>
				</div>
				<section class="content">
					<!-- content -->
					<div class="row">
						<div class="col-md-12">
							<div class="box box-primary direct-chat direct-chat-primary">
								<div class="box-header with-border">
									<h3 class="box-title">呆蜗牛Demo</h3>
									<div class="box-tools pull-right">
										<button type="button" class="btn btn-box-tool" data-widget="chat-pane-toggle">
											<i class="fa fa-users"></i>
											<span id="userCount" data-toggle="tooltip" title="0 个用户在线" class="badge bg-light-blue">0</span>
										</button>
										<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
										</button>
										<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
									</div>
								</div>
								<!-- /.box-header -->
								<div class="box-body">
									<!-- Conversations are loaded here -->
									<div id="msgDiv" class="direct-chat-messages">
										<div id="emptyDiv">
											呆蜗牛Demo （案例：<a href="http://www.daiwoniu.com" target="_blank">呆蜗牛爱唠叨系统</a> ）！！！
										</div>
									</div>
									<!--/.direct-chat-messages-->
									<div class="direct-chat-contacts">
										<ul class="contacts-list" id="userListUl">
										</ul>
										<!-- /.contatcts-list -->
									</div>
								</div>
								<!-- /.box-body -->
								<div class="box-footer">
									<input type="hidden" id="nichengDb" value="${userContext.user.name}"/>
									<input type="hidden" id="userDb" value="${userContext.user.id}"/>
									<c:if test="${userContext.user==null}">
										<div class="row">
											<div class="col-xs-1 col-md-1">
												昵称：
											</div>
											<div class="col-xs-11 col-md-11">
												<input style="width: 150px;" type="text" id="nicheng" name="nicheng" placeholder="输入唠嗑的昵称 ..." class="form-control">
											</div>
										</div>
										<br/>
									</c:if>
									<div class="row">
										<div class="col-xs-1 col-md-1">
											内容：
										</div>
										<div class="col-xs-11 col-md-11">
											<div id="baiduEditorDom" name="content"></div>
											<textarea rows="4" id="message" name="message" placeholder="输入唠嗑的话 ..." class="form-control"></textarea>
											<p class="help-block">Shift+Enter 直接发送</p>
										</div>
									</div>
									<br/>
									<div class="row">
										<div class="col-xs-1 col-md-1">
										</div>
										<div class="col-xs-11 col-md-11">
											<button type="button" id="sendMsg" class="btn btn-primary">走你</button>
											<br/>
											<br/>
											<p class="help-block">必须至少两人同时打开这个页面时，你发信息别人才能收到哦（心累）！</p>
											<p class="help-block">页面一刷新，就会重新连接了，你的唠嗑记录就会没了哦，就又得重新开始唠嗑了，请慎重刷新哦（心累）！</p>
											<p class="help-block">要查看历史记录，请点击左下角“查看历史”（心累）！</p>
										</div>
									</div>
								</div>
								<!-- /.box-footer-->
							</div>
						</div>
					</div>
					<br/>
					<br/>
					<div class="row">
						<div class="col-md-12">
							<div class="box box-primary direct-chat direct-chat-primary">
								<div class="box-header with-border">
									<h3 class="box-title">更新版本历史</h3>
									<div class="box-tools pull-right">
										<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
									</div>
								</div>
								<div class="box-body">
									<div class="alert alert-info alert-dismissible">
										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
										<h4><i class="icon fa fa-bullhorn"></i> V 1.0.3 版本新功能（2016-05-20）</h4>
										<ol>
											<li>支持QQ分享功能...（心累）！</li>
											<li>显示更新版本历史功能...（心累）！</li>
										</ol>
									</div>
									<div class="alert alert-info alert-dismissible">
										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
										<h4><i class="icon fa fa-bullhorn"></i> V 1.0.2 版本新功能（2016-05-19）</h4>
										<ol>
											<li>修改系统名称为<strong>呆蜗牛爱唠叨</strong>...（心累）！</li>
											<li>系统会记录访客自己设置的昵称，一周内再打开不会再自动生成，但是如果换浏览器就不行了...（心累）！</li>
											<li>支持查看当前在线访客功能...（心累）！</li>
											<li>支持访客上线、下线、修改昵称时，系统提示功能...（心累）！</li>
											<li>支持最小化聊天窗口功能...（心累）！</li>
										</ol>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- /. content -->
				</section>
			</div>
			<!-- /. Main content -->
		</div>
		<!-- /.content-wrapper -->
		<!-- Main Footer -->
		<footer class="main-footer">
			<jsp:include page="/WEB-INF/pages/footer.jsp"/>
		</footer>
		<script src="/assets/themes/adminLTE/bootstrap/js/bootstrap.min.js"></script>
		<script src="/assets/themes/adminLTE/adminLTE/js/app.min.js"></script>
		<script src="/assets/common.js"></script>

		<script src="/assets/ueditor/ueditor.config.js"></script>
		<script src="/assets/ueditor/ueditor.all.min.js"></script>
		<script src="/assets/ueditor/ueditor.parse.min.js"></script>
		<script src="/assets/ueditor/lang/zh-cn/zh-cn.js"></script>
	</div><!-- ./wrapper -->
</body>
<script>
	$(document).ready(function () {
		$("#showMsgList").on("click", function(){
		});
		$("#sendMsg").on("click", function(){
		});
		var keyDow = 0;
		// 按shift+回车
		$("#message").keydown(function (key) {
			if(key.keyCode == 13){
				if(keyDow == 16){
					return false;
				}
			}else{
				if (key.keyCode == 16) {
					keyDow = 16;
				}else{
					keyDow = 0;
				}
			}
		});
		$("#message").keyup(function (key) {
			if (key.keyCode == 13 && keyDow == 16) {
				$("#sendMsg").click();
			}
		});



		var ue = UE.getEditor('baiduEditorDom',{
			enableAutoSave: false,
			initialFrameWidth: 800,
			initialFrameHeight: 500,
			autoFloatEnabled: false,
			emotionLocalization: true
		});
		ue.ready(function() {
			ue.setContent('');
		});
	});
</script>
</html>
